<template>
   <view class="goodsList-item-box">
     <view class="goodsList-item-image" >
       <image :src="goods.goods_small_logo || defaultPic" mode=""></image>
     </view>
     <view class="goodsList-item-info">
       <view class="goodsList-item-title">
         {{goods.goods_name}}
       </view>
       <view class="goodsList-item-price">
         ¥{{goods.goods_price | tofixed}}
       </view>
     </view>
   </view>
</template>

<script>
  export default {
    name:"my-goods",
    props: {
      goods: {
        type:Object,
        default:{},
      }
    },
    filters:{
      tofixed (num) {
        return Number(num).toFixed(2)
      }
    },
    data() {
      return {
        defaultPic:'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
      };
    }
  }
</script>

<style lang="scss">
.goodsList-item-box {
  display: flex;
  padding: 10px 5px;
  border-bottom: 1px solid #f0f0f0;
  .goodsList-item-image {
    margin-right: 5px;
    image {
      width: 100px;
      height: 100px;
      display: block;
    }
  }
  .goodsList-item-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    .goodsList-item-title {
      font-size: 14px;
    } 
    .goodsList-item-price {
      font-size: 16px;
      color: #c00000;
    }
}
}
</style>